﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ShopProject.Back
{
    public partial class logout : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Session.Clear();
            if (Request.Cookies["user"] == null)
            {
                Response.Redirect("/Login.aspx");
            }
            else
            {
                HttpCookie myCookie = Request.Cookies["user"];
                myCookie.Expires = DateTime.Now.AddDays(-1);
                Response.Cookies.Add(myCookie);

                Response.Redirect("/Login.aspx");
            }           
        }
    }
}
